<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="${ctx }">
<!-- 字符编码 -->
<meta charset="UTF-8" content="">
<!-- IE兼容模式 -->
<meta http-equiv="X-UA-COMPATIBLE" content="IE=edge">
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<!-- 采用高速模式渲染（目前仅有360支持） -->
<meta name="renderer" content="webkit">
<!-- Bootstrap 核心 CSS库 -->
<link href="${ctx }/styles/BJUI/new/css/bootstrap.min.css"
	rel="stylesheet">
<!-- Font-awesome 图标 CSS库 -->
<link href="${ctx }/styles/BJUI/new/css/font-awesome.min.css"
	rel="stylesheet">
<!-- JQuery UI CSS库 -->
<link href="${ctx }/styles/BJUI/new/css/jquery-ui.min.css"
	rel="stylesheet">
<!-- JQuery -->
<script src="${ctx }/styles/BJUI/new/js/jquery-1.10.2.min.js"
	type="text/javascript"></script>
<script src="${ctx }/styles/BJUI/new/js/jquery.unobtrusive-ajax.min.js"
	type="text/javascript"></script>
<!-- JQuery UI -->
<script src="${ctx }/styles/BJUI/new/js/jquery-ui.min.js"
	type="text/javascript"></script>
<!-- 脉动提示插件 -->
<script src="${ctx }/styles/BJUI/new/js/jquery.pulsate.min.js"
	type="text/javascript"></script>
<!-- Bootstrap 核心 JS库 -->
<script src="${ctx }/styles/BJUI/new/js/bootstrap.min.js"
	type="text/javascript"></script>
<!-- 浏览器判断 -->
<script src="${ctx }/styles/BJUI/new/js/Browser.js"
	type="text/javascript"></script>
<!-- 母版页 样式 -->
<link href="${ctx }/styles/BJUI/new/css/carousel.css" rel="stylesheet">
<link href="${ctx }/styles/BJUI/new/css/style.css" rel="stylesheet">
<link href="${ctx }/styles/BJUI/new/css/leon.css" rel="stylesheet">
<link href="${ctx }/styles/BJUI/new/css/index.css" rel="stylesheet">

<title>查询</title>
</head>
<body>
	<!-- Start: Ajax Tiper -->
	<!-- Start AJAX提示（全局） -->
	<link href="${ctx }/styles/BJUI/new/css/nprogress.css" rel="stylesheet">
	<script src="${ctx }/styles/BJUI/new/js/nprogress.js"
		type="text/javascript"></script>
	<script type="text/javascript">
		var CurrAjaxCount = 0;
		$(document).ready(function() {
			$(document).ajaxStart(function() {
				if (CurrAjaxCount == 0) {
					NProgress.start();
				}
				CurrAjaxCount = CurrAjaxCount + 1;
			}).ajaxStop(function() {
				CurrAjaxCount = CurrAjaxCount - 1;
				if (CurrAjaxCount <= 0) {
					NProgress.done();
				}
			});
		});
	</script>
	<!-- End AJAX提示（全局） -->
	<!-- End: Ajax Tiper -->

	<!-- Start: Browser Tiper -->
	<link href="${ctx }/styles/BJUI/new/css/Browsertiper.css"
		rel="stylesheet" />

	<!-- End: Browser Tiper -->

	<div class="clearfix">
		<div class="carousel-inner" id="mainWindow" style="position: relative">
			<!--	<div class="btn-group btn-group-justified" role="group"
				style="padding: 10px; background-color: #000000">
				<div class="btn-group background-black" role="group">
					<button type="button" onclick='getList(0,"${userId}")'
						class="btn btn-default background-black btn-NavBar">全部</button>
				</div>
				<div class="btn-group background-black" role="group">
					<button type="button" onclick='getList(1,"${userId}")'
						class="btn btn-default background-black btn-NavBar">待接单</button>
				</div>
				<div class="btn-group background-black" role="group">
					<button type="button"
						class="btn btn-default background-black btn-NavBar">已接单</button>
				</div>
				<div class="btn-group" role="group">
					<button type="button" onclick='getList(3,"${userId}")'
						class="btn btn-default background-black btn-NavBar">配送中</button>
				</div>
				<div class="btn-group" role="group">
					<button type="button" onclick='getList(4,"${userId}")'
						class="btn btn-default background-black btn-NavBar">已完成</button>
				</div>
			</div>-->


			<div class="btn-group btn-group-justified" role="group"
				style="padding: 10px; background-color: #0099CC; position: absolute; z-index: 1">
				<div class="btn-group background-black" role="group"  style="background-color: #0099CC;">
					<button type="button"
						class="btn btn-default background-black btn-NavBar" id="btn1"
						onclick='getList(2,"${userId}")'>验证司机</button>
				</div>
				<div class="btn-group background-black" role="group"  style="background-color: #0099CC;">
					<button type="button"
						class="btn btn-default background-black btn-NavBar" id="btn2"
						onclick='getList(0,"${userId}")'>订单状态</button>
				</div>
			</div>
			<div class="display-right"
				style="position: absolute; top: 4px; right: 0; z-index: 999">
				<div class="dropdown display-right"
					style="margin-top: 8px; margin-right: 15px">
					<button class="btn btn-default dropdown-toggle" type="button"
						id="dropDownMenu" data-toggle="dropdown" aria-haspopup="true"
						aria-expanded="true"
						style="border: none; height: 30px; color: #a9a9a9; background-color: #0099CC">
						<i class="fa fa-angle-down" style="font-size: 20px; width: 10px"></i>
					</button>
					<ul class="dropdown-menu" aria-labelledby="dropDownMenu"
						style="min-width: 0; right: 0; left: auto;z-index: 999">
						<li><a onclick='getList(0,"${userId}")'>待支付</a></li>
						<li><a onclick='getList(1,"${userId}")'>待接单</a></li>
						<li><a onclick='getList(3,"${userId}")'>配送中</a></li>
						<li><a onclick='getList(4,"${userId}")'>已完成</a></li>
					</ul>
				</div>
			</div>
			<div id="dataLayout" class="carousel-inner" style="margin-top: 60px">
				<c:forEach var="item" items="${list}" varStatus="status">
					<!-- 结束 -->
					<div class="row">
						<div class="col-sm-8 box-40-mb-1"
							onclick="orderDetails(${item.id})">
							<span class="label-text">订单号:${item.orderNum} </span> <span
								class="label-text display-right mr-10 color-orange">${item.orderStatusStr}
							</span>
						</div>
						<div class="col-sm-8 box-border-bottom-solid"
							onclick="orderDetails(${item.id})">
							<div class="text-center pd-10">${item.originAddress}&nbsp&nbsp
								${item.originName} / ${item.originPhone}</div>
							<div class="text-center pd-10 color-black">至</div>
							<div class="text-center pd-10">${item.destinationAddress}&nbsp&nbsp${item.destinationName}
								/ ${item.destinationPhone}</div>
						</div>

						<div class="col-sm-8 box-40-mb-1">
							<span class="label-text">下单时间：${item.time}</span> <span
								class="label-text display-right mr-10 color-placeholder">${item.isPay}</span>
						</div>



						<c:choose>
							<c:when test="${item.orderStatus == 0}">

								<div onclick="weixinpay(${item.id})"
									class="col-sm-8 box-40-mb-1" style="margin-bottom: 0">
									<a class="a-blue">
										<div class="text-center" style="width: 100%;">
											<span style="line-height: 40px; color: #ffffff">去支付</span>
										</div>
									</a>
								</div>
								<div class="col-sm-8" style="position: relative;">
									<div class="item-size" style="height: 30px"></div>
								</div>
							</c:when>

							<c:when test="${item.orderStatus == 2}">
								<div class="col-sm-8 box-40-mb-1"
									onclick="details('${item.receiveAccountId}')">
									<span class="label-text">接单人：${item.nickname} </span> <img
										src="${ctx }/styles/BJUI/new/images/right-skip.png"
										class="display-right skip-right" alt="" /> <img
										src="${item.facePath}"
										class="display-right header-right img-circle" alt="" />
								</div>
								<div class="col-sm-8 box-40-mb-1" style="margin-bottom: 0">
									<a class="a-blue">
										<div class="text-center" style="width: 100%;">
											<span style="line-height: 40px; color: #ffffff">验证取件人</span>
										</div>
									</a>
								</div>

								<div class="col-sm-8 text-center"
									style="width: 100%; height: 10px; margin-bottom: 0">
									<span class="glyphicon glyphicon-triangle-top color-white"
										aria-hidden="true" style="height: 10px"></span>
								</div>

								<div class="col-sm-8 box-size-40"
									style="background-color: #ffffff">
									<a class="a-orange" target="_blank" data-toggle="modal"
										data-target="#StudentModal" tabindex="-1"
										onclick="javascript:verify(${item.id})">
										<div class="display-right text-center label-and-input"
											style="width: 20%;">
											<span style="line-height: 40px; color: #ffffff">验证</span>
										</div>
									</a> <input id="input${item.id}"
										class="input-max display-left placeholder-left"
										placeholder="请输入签收验证码,由签收人提供">
								</div>
								<div class="col-sm-8" style="position: relative;">
									<div class="item-size" style="height: 30px"></div>
								</div>

							</c:when>
							<c:when test="${item.orderStatus == 3}">
								<div class="col-sm-8 box-40-mb-1"
									onclick="details('${item.receiveAccountId}')">
									<span class="label-text">接单人：${item.nickname} </span> <img
										src="${ctx }/styles/BJUI/new/images/right-skip.png"
										class="display-right skip-right" alt="" /> <img
										src="${item.facePath}"
										class="display-right header-right img-circle" alt="" />
								</div>
							</c:when>
							<c:otherwise>
								<div class="col-sm-8" style="position: relative;">
									<div class="item-size" style="height: 10px"></div>
								</div>
							</c:otherwise>
						</c:choose>

						<!-- 结束 -->
					</div>
				</c:forEach>
			</div>
			<div id class="carousel-inner">
				<div onclick="more()" class="col-sm-8 box-40-mb-1" 
					style="margin-bottom: 0;height:100px">
					<a class="a-blue">
						<div class="text-center" style="width: 100%;">
							<span style="line-height: 40px; color: #ffffff">加载更多</span>
						</div>
					</a>
				</div>
			</div>
		</div>
	</div>

	<script type="text/javascript" charset="UTF-8">
	
	
	
       
	

		function more() {

			page = page + 1;
			if (ajax) {
				dialog1("正在请求数据，请稍后操作");
				return;
			}
			ajax = true;

			var ajaxTimeoutTest = $
					.ajax({
						timeout : 10000,
						type : "GET",
						dataType : 'json',
						url : "${ctx }/weixin/orderLists?orderStatus=" + status
								+ "&launchAccountId=" + "${userId}"
								+ "&pageNum=" + page + "&pageNum=8",
						error : function(data) {
							dialog1("出错了！！:");
						},
						complete : function(XMLHttpRequest, status) { //请求完成后最终执行参数
							if (status == 'timeout') {//超时,status还有success,error等值的情况
								ajaxTimeoutTest.abort();
								dialog1("网络超时");
								ajax = false;
							}
						},
						success : function(data) {
							if (data["status"] == 0) {
								var data = data["data"];
								mainWindow.css({
									height : "auto"
								});
								var str = $("#dataLayout").html();
								for (var i = 0; i < data.length; i++) {
									var id=data[i]['receiveAccountId'];
									str += "<div class='row'><div class='col-sm-8 box-40-mb-1'onclick='orderDetails("
											+ data[i]['id']
											+ ")'><span class='label-text'>订单号:"
											+ data[i]['orderNum']
											+ "</span> <span"
								+"   class='label-text display-right mr-10 color-orange'>"
											+ data[i]['orderStatusStr']
											+ "</span></div><div class='col-sm-8 box-border-bottom-solid'  "
											+ "onclick='orderDetails("
											+ data[i]['id']
											+ ")'><div class='text-center pd-10'>"
											+ data[i]['originAddress']
											+ "&nbsp&nbsp"
											+ data[i]['originName']
											+ "  / "
											+ data[i]['originPhone']
											+ " </div>"
											+ "<div class='text-center pd-10 color-black'>至</div><div class='text-center pd-10'>"
											+ data[i]['destinationAddress']
											+ "&nbsp&nbsp "
											+ data[i]['destinationName']
											+ "/  "
											+ data[i]['destinationPhone']
											+ "</div>"
											+ "</div><div class='col-sm-8 box-40-mb-1'><span class='label-text'>下单时间："
											+ data[i]['time']
											+ "</span> <span  class='label-text display-right mr-10 color-placeholder'> "
											+ data[i]['isPay']
											+ "</span></div>" + "";
									switch (data[i]['orderStatus']) {
									case 0:
										str = str
												+ "<div onclick='weixinpay("
												+ data[i]['id']
												+ ")'  class='col-sm-8 box-40-mb-1' style='margin-bottom: 0'><a class='a-blue'><div class='text-center' style='width: 100%;'>"
												+ "<span style='line-height: 40px; color: #ffffff'>去支付</span></div></a></div>"
												+ "<div class='col-sm-8' style='position: relative;'><div class='item-size' style='height: 30px'></div></div>";
										break;								
									case 2:
											str = str+"<div class='col-sm-8 box-40-mb-1'  onclick='details(\""+id+"\")'> <span class='label-text'>接单人："
												+ data[i]['nickname']
												+ " </span> <img   src='${ctx }/styles/BJUI/new/images/right-skip.png'  class='display-right skip-right' alt='' /> <img  src='  "
												+ data[i]['facePath']
												+ "'  class='display-right header-right img-circle' alt='' /></div><div class='col-sm-8 box-40-mb-1' style='margin-bottom: 0'><a class='a-blue'>"
												+"<div class='text-center' style='width: 100%;'>	<span style='line-height: 40px; color: #ffffff'>验证取件人</span>	</div></a></div><div class='col-sm-8 text-center' "
												+"style='width: 100%; height: 10px; margin-bottom: 0'> <span class='glyphicon glyphicon-triangle-top color-white'  aria-hidden='true' style='height: 10px'></span>"
												+"</div><div class='col-sm-8 box-size-40'   style='background-color: #ffffff'><a class='a-orange' target='_blank' data-toggle='modal'   data-target='#StudentModal' tabindex='-1'  "
												+"	onclick='javascript:verify("
												+ data[i]['id']
												+ ")'>   <div class='display-right text-center label-and-input'  	style='width: 20%;'>  <span style='line-height: 40px; color: #ffffff'>验证</span></div>"
												+"</a> <input id='input"
												+ data[i]['id']
												+ "'     class='input-max display-left placeholder-left'  placeholder='请输入签收验证码,由签收人提供'>  </div>"  
													+ "<div class='col-sm-8' style='position: relative;'><div class='item-size' style='height: 30px'></div></div>";;
										break;
									case 3:
										str = str+"<div class='col-sm-8 box-40-mb-1'   onclick='details(\""+id+"\")'>  <span class='label-text'>接单人："
												+ data[i]['nickname']
												+ " </span> <img  src='${ctx }/styles/BJUI/new/images/right-skip.png' class='display-right skip-right' alt='' /> <img src='"
												+ data[i]['facePath']
												+ "' class='display-right header-right img-circle' alt='' /></div>"	
												+ "<div class='col-sm-8' style='position: relative;'><div class='item-size' style='height: 10px'></div></div>";
									
										break;
									case 4:
										str = str+"<div class='col-sm-8 box-40-mb-1'   onclick='details(\""+id+"\")'>  <span class='label-text'>接单人："
												+ data[i]['nickname']
												+ " </span> <img  src='${ctx }/styles/BJUI/new/images/right-skip.png' class='display-right skip-right' alt='' /> <img src='"
												+ data[i]['facePath']
												+ "' class='display-right header-right img-circle' alt='' /></div>"	
												+ "<div class='col-sm-8' style='position: relative;'><div class='item-size' style='height: 10px'></div></div>";
										break;
									default:
										str = str
												+ "<div class='col-sm-8' style='position: relative;'><div class='item-size' style='height: 10px'></div></div>";
										break;
									}
									str = str + "</div> ";
								}

								$("#dataLayout").html(str);
								changeDivSize();
								ajax = false;
							} else if (data["status"] == 2) {
								dialog1("没有更多的数据");
								page = page - 1;
								ajax = false;
							}
						}
					});
		}
		var page = 1;
		var status = 0;
		function orderDetails(id) {

			window.location.href = "${ctx }/weixinView/orderDetails?id=" + id;
		}
		function details(id) {
			window.location.href = "${ctx }/weixinView/dataPersonal?usersId="
					+ id;
		}
		function weixinpay(id) {
			window.location.href = "${ctx }/weixin/order.do?id=" + id;

		}

		function verify(id) {
			var s = $("#input" + id).val();

			if (!/^[0-9]*$/.test(s)) {
				dialog1("请输入数字!");
			}
			$.ajax({
				type : "GET",
				dataType : 'json',
				url : "${ctx }/weixinView/collectCode?id=" + id
						+ "&collectCode=" + s,
				error : function(data) {
					dialog1("出错了！！:");
				},
				success : function(data) {
					if (data["status"] == 0) {
						dialog1(data["msg"]);
					 getList(2, "${userId}")
					} else if (data["status"] == 1) {
						dialog1(data["msg"]);
					}
				}
			});
		}
		var ajax = false;
		function getList(val, userid) {
			page = 1;
			status = val;
			if (ajax) {
				dialog1("正在请求数据，请稍后操作");
				return;
			}
			ajax = true;

			var ajaxTimeoutTest = $
					.ajax({
						timeout : 10000,
						type : "GET",
						dataType : 'json',
						url : "${ctx }/weixin/orderLists?orderStatus=" + val
								+ "&launchAccountId=" + userid,
						error : function(data) {
							dialog1("出错了！！:");
						},
						complete : function(XMLHttpRequest, status) { //请求完成后最终执行参数
							if (status == 'timeout') {//超时,status还有success,error等值的情况
								ajaxTimeoutTest.abort();
								dialog1("网络超时");
								ajax = false;
							}
						},
						success : function(data) {
							if (data["status"] == 0) {
								var data = data["data"];
								mainWindow.css({
									height : "auto"
								});
								var str = "";
								for (var i = 0; i < data.length; i++) {
									var id=data[i]['receiveAccountId'];
									str += "<div class='row'><div class='col-sm-8 box-40-mb-1'onclick='orderDetails("
											+ data[i]['id']
											+ ")'><span class='label-text'>订单号:"
											+ data[i]['orderNum']
											+ "</span> <span"
								+"   class='label-text display-right mr-10 color-orange'>"
											+ data[i]['orderStatusStr']
											+ "</span></div><div class='col-sm-8 box-border-bottom-solid'  "
											+ "onclick='orderDetails("
											+ data[i]['id']
											+ ")'><div class='text-center pd-10'>"
											+ data[i]['originAddress']
											+ "&nbsp&nbsp"
											+ data[i]['originName']
											+ "  / "
											+ data[i]['originPhone']
											+ " </div>"
											+ "<div class='text-center pd-10 color-black'>至</div><div class='text-center pd-10'>"
											+ data[i]['destinationAddress']
											+ "&nbsp&nbsp "
											+ data[i]['destinationName']
											+ "/  "
											+ data[i]['destinationPhone']
											+ "</div>"
											+ "</div><div class='col-sm-8 box-40-mb-1'><span class='label-text'>下单时间："
											+ data[i]['time']
											+ "</span> <span  class='label-text display-right mr-10 color-placeholder'> "
											+ data[i]['isPay']
											+ "</span></div>" + "";
									switch (data[i]['orderStatus']) {
									case 0:
										str = str
												+ "<div onclick='weixinpay("
												+ data[i]['id']
												+ ")'  class='col-sm-8 box-40-mb-1' style='margin-bottom: 0'><a class='a-blue'><div class='text-center' style='width: 100%;'>"
												+ "<span style='line-height: 40px; color: #ffffff'>去支付</span></div></a></div>"
												+ "<div class='col-sm-8' style='position: relative;'><div class='item-size' style='height: 30px'></div></div>";
										break;								
									case 2:
											str = str+"<div class='col-sm-8 box-40-mb-1'  onclick='details(\""+id+"\")'> <span class='label-text'>接单人："
												+ data[i]['nickname']
												+ " </span> <img   src='${ctx }/styles/BJUI/new/images/right-skip.png'  class='display-right skip-right' alt='' /> <img  src='  "
												+ data[i]['facePath']
												+ "'  class='display-right header-right img-circle' alt='' /></div><div class='col-sm-8 box-40-mb-1' style='margin-bottom: 0'><a class='a-blue'>"
												+"<div class='text-center' style='width: 100%;'>	<span style='line-height: 40px; color: #ffffff'>验证取件人</span>	</div></a></div><div class='col-sm-8 text-center' "
												+"style='width: 100%; height: 10px; margin-bottom: 0'> <span class='glyphicon glyphicon-triangle-top color-white'  aria-hidden='true' style='height: 10px'></span>"
												+"</div><div class='col-sm-8 box-size-40'   style='background-color: #ffffff'><a class='a-orange' target='_blank' data-toggle='modal'   data-target='#StudentModal' tabindex='-1'  "
												+"	onclick='javascript:verify("
												+ data[i]['id']
												+ ")'>   <div class='display-right text-center label-and-input'  	style='width: 20%;'>  <span style='line-height: 40px; color: #ffffff'>验证</span></div>"
												+"</a> <input id='input"
												+ data[i]['id']
												+ "'     class='input-max display-left placeholder-left'  placeholder='请输入签收验证码,由签收人提供'>  </div>"  
													+ "<div class='col-sm-8' style='position: relative;'><div class='item-size' style='height: 30px'></div></div>";;
										break;
									case 3:
										str = str+"<div class='col-sm-8 box-40-mb-1'   onclick='details(\""+id+"\")'>  <span class='label-text'>接单人："
												+ data[i]['nickname']
												+ " </span> <img  src='${ctx }/styles/BJUI/new/images/right-skip.png' class='display-right skip-right' alt='' /> <img src='"
												+ data[i]['facePath']
												+ "' class='display-right header-right img-circle' alt='' /></div>"	
												+ "<div class='col-sm-8' style='position: relative;'><div class='item-size' style='height: 10px'></div></div>";
									
										break;
									case 4:
										str = str+"<div class='col-sm-8 box-40-mb-1'   onclick='details(\""+id+"\")'>  <span class='label-text'>接单人："
												+ data[i]['nickname']
												+ " </span> <img  src='${ctx }/styles/BJUI/new/images/right-skip.png' class='display-right skip-right' alt='' /> <img src='"
												+ data[i]['facePath']
												+ "' class='display-right header-right img-circle' alt='' /></div>"	
												+ "<div class='col-sm-8' style='position: relative;'><div class='item-size' style='height: 10px'></div></div>";
										break;
									default:
										str = str
												+ "<div class='col-sm-8' style='position: relative;'><div class='item-size' style='height: 10px'></div></div>";
										break;
									}
									str = str + "</div> ";
								}
								$("#dataLayout").html(str);
								changeDivSize();
								ajax = false;
							} else if (data["status"] == 2) {
								dialog1("没有更多的数据");
								$("#dataLayout").html("");
								ajax = false;
							}
						}
					});
		}
		//两个参数
		function dialog2(content) {
			$("#dilogContent2").html(content);
			var orderVerifyValue = $("#orderVerify").html();
			Modal_Resize(240);
			getH();
			$(".modal-dialog").html(orderVerifyValue);
		}
		//一个参数
		function dialog1(content) {
			alert(content);
		}
		var modalH;

		function getH() {
			alert("windowH=" + windowH);
			alert("modalH=" + modalH);
			alert("modelH=" + $("#modalT").height());
			modalT
			$("#modalT").css({
				'height' : (windowH - modalH) / 2
			});
			alert("modelH=" + $("#modalT").height());
		}

		var mainWindow = $("#mainWindow");
		var mainH;
		var itemW;
		var label;
		var placeholder;
		var button = $(".btn-NavBar");
    var dropDownMenu = $("#dropDownMenu");
    var btn1 = $("#btn1");
    var btn2 = $("#btn2");

		/* 动态改变页面尺寸 */
		window.onresize = function() {
			itemW = $(".col-sm-8").width();
			changeDivSize();
		};

		$(function() {
			changeDivSize();
		});

		function changeDivSize() {
			itemW = $(".col-sm-8").width();
			label = $(".label-and-input");
			placeholder = $(".placeholder-left");
			mainH = mainWindow.height();
			for (var i = 0; i < label.size(); i++) {
				var labelW = $(label[i]).width();
				$(placeholder[i]).css({
					width : itemW - labelW - 1
				});
			}
			if (windowH > mainH) {
				$("#mainWindow").css({
					height : windowH
				});
			}
		}

	$(function(){
	 $(button[0]).css({background: "#ffffff", color: "#0099CC"});
	  $(button[1]).css({background: "#0099CC", color: "#ffffff"});
        button.click(function () {
            button.css({background: "#0099CC", color: "#ffffff"});
            dropDownMenu.css({background: "#0099CC", color: "#ffffff"});
            $(this).css({background: "#ffffff", color: "#0099CC", 'border-color': '#ffffff'});
        })

        btn1.click(function(){
            dropDownMenu.css({background: "#0099CC", color: "#ffffff"});
        });
        btn2.click(function(){
            dropDownMenu.css({background: "#ffffff", color: "#0099CC"});
        });
	
	})
		var windowH = $(window).height();
		function verifyOK(width) {
			Modal_Resize(width);
			getH();
			$(".modal-dialog").html(verifyOKValue);
		}
		function orderVerify(width) {
			Modal_Resize(width);
			getH();
			$(".modal-dialog").html(orderVerifyValue);
		}

		function textZ() {
			alert("modalH=" + modalH);
		}

		$("#test").click(function() {
			mainWindow.css({
				height : "auto"
			});
			$("#order_container").html(str);
			changeDivSize();
		});
	</script>


</body>
</html>
